import request from '@/util/ProRequest.js'

// 分页查询常见缺陷
export function getCommonDefectPage(pageNum, pageSize, commonDefect) {
    return request({
        url: '/commonDefect/page',
        method: 'get',
        params: {
            pageNum,
            pageSize,
            ...commonDefect
        }
    })
}

// 根据id编码查询供应商
export function getCommonDefectById(id) {
    return request({
        url: `/commonDefect/get/${id}`,
        method: 'get'
    })
}

// 新增供应商
export function addCommonDefect(data) {
    return request({
        url: '/commonDefect/add',
        method: 'post',
        data
    })
}

// 更新供应商
export function updateCommonDefect(data) {
    return request({
        url: '/commonDefect/update',
        method: 'put',
        data
    })
}

// 删除供应商
export function deleteCommonDefect(id) {
    return request({
        url: `/commonDefect/delete/${id}`,
        method: 'delete'
    })
}

// 批量删除供应商
export function batchDeleteWorkflow(ids) {
    return request({
        url: '/commonDefect/batchDelete?'+ids,
        method: 'delete'
    })
}
